clear all
set maxvar 30000
version 14
capture log close
set more off

****************************************************************************************************
* -----   Customize the paths and options:   ----- 
****************************************************************************************************
*cd  "Data\"
global MY_IN_PATH   "C:\Users\benjamin.balsmeier\Dropbox\Research\REStat\data"
global MY_OUT_PATH  "C:\Users\benjamin.balsmeier\Dropbox\Research\REStat\data"
*global MY_TEMP_PATH "..."

global MY_OUT_FILE  ${MY_OUT_PATH}out.dta
global MY_LOG_FILE  ${MY_OUT_PATH}cr_out.log

log using "${MY_LOG_FILE}", text replace
****************************************************************************************************
* import CS data
*************************************************************************************************

use ${MY_IN_PATH}/nberces.dta, clear

gen out = matcost + vadd

gen ship_def = vship/piship

gen out_d = out/piship

xtset sic year
gen lout_d = l.out_d
gen l2out_d = l2.out_d
gen l3out_d = l3.out_d
keep sic year out_d lout_d l2out_d l3out_d ship_def 

save ${MY_IN_PATH}/output_nber_sic4_2020.dta, replace

exit
